package com.tengju.data.domain.model.report;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author chenhang
 * @Date 2021/9/18
 */
@Getter
public enum DataAchievementBonusDateConfigType {

    DATA_RANGE(1,"数据结算周期"),

    LAST_CAL_DATE(2,"数据结算日期"),

    SETTLE_DATE(3,"补贴入账日期"),

    CAL_RISK(4,"风控对比计算");

    private int code;
    private String desc;

    DataAchievementBonusDateConfigType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static DataAchievementBonusDateConfigType parse(int code) {
        return Arrays.stream(DataAchievementBonusDateConfigType.values())
                .filter(k -> k.getCode() == code)
                .findFirst().orElse(null);
    }
}
